package com.hngates.architecture.service.impl;

import java.util.List;

import com.hngates.architecture.domain.ArcLabourCompany;
import com.hngates.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hngates.architecture.mapper.ArcLabourSubCompanyMapper;
import com.hngates.architecture.domain.ArcLabourSubCompany;
import com.hngates.architecture.service.IArcLabourSubCompanyService;
import com.hngates.common.core.text.Convert;

/**
 * 劳务分包单位Service业务层处理
 * 
 * @author jwhe
 * @date 2022-07-04
 */
@Service
public class ArcLabourSubCompanyServiceImpl implements IArcLabourSubCompanyService 
{
    @Autowired
    private ArcLabourSubCompanyMapper arcLabourSubCompanyMapper;

    /**
     * 查询劳务分包单位
     * 
     * @param id 劳务分包单位主键
     * @return 劳务分包单位
     */
    @Override
    public ArcLabourSubCompany selectArcLabourSubCompanyById(Long id)
    {
        return arcLabourSubCompanyMapper.selectArcLabourSubCompanyById(id);
    }

    /**
     * 查询劳务分包单位列表
     * 
     * @param arcLabourSubCompany 劳务分包单位
     * @return 劳务分包单位
     */
    @Override
    public List<ArcLabourSubCompany> selectArcLabourSubCompanyList(ArcLabourSubCompany arcLabourSubCompany)
    {
        return arcLabourSubCompanyMapper.selectArcLabourSubCompanyList(arcLabourSubCompany);
    }

    /**
     * 新增劳务分包单位
     * 
     * @param arcLabourSubCompany 劳务分包单位
     * @return 结果
     */
    @Override
    public int insertArcLabourSubCompany(ArcLabourSubCompany arcLabourSubCompany)
    {
        arcLabourSubCompany.setCreateTime(DateUtils.getNowDate());
        return arcLabourSubCompanyMapper.insertArcLabourSubCompany(arcLabourSubCompany);
    }

    /**
     * 修改劳务分包单位
     * 
     * @param arcLabourSubCompany 劳务分包单位
     * @return 结果
     */
    @Override
    public int updateArcLabourSubCompany(ArcLabourSubCompany arcLabourSubCompany)
    {
        arcLabourSubCompany.setUpdateTime(DateUtils.getNowDate());
        return arcLabourSubCompanyMapper.updateArcLabourSubCompany(arcLabourSubCompany);
    }

    /**
     * 批量删除劳务分包单位
     * 
     * @param ids 需要删除的劳务分包单位主键
     * @return 结果
     */
    @Override
    public int deleteArcLabourSubCompanyByIds(String ids)
    {
        return arcLabourSubCompanyMapper.deleteArcLabourSubCompanyByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除劳务分包单位信息
     * 
     * @param id 劳务分包单位主键
     * @return 结果
     */
    @Override
    public int deleteArcLabourSubCompanyById(Long id)
    {
        return arcLabourSubCompanyMapper.deleteArcLabourSubCompanyById(id);
    }

    @Override
    public ArcLabourSubCompany selectArcLabourSubCompanyByName(String companyName) {
        return arcLabourSubCompanyMapper.selectArcLabourSubCompanyByName(  companyName);
    }
}
